<html>
<head>
    <meta charset="UTF-8">
    <title>myinserttable</title>
    <script type="text/javascript" src="../internal.js"></script>
    <script type="text/javascript" src="../../../jquery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
    dialog.onok = function testOnok(){
    	var opt = {
    		width:'',
    		height:'',
    		numcol:'',
    		numrow:'',
    		tdwidth:'',
    		tdheight:''
    	}
    	if($('input:radio[name="definition"]:checked').val()=='predefine') {
    		//预定义a4纸
    		if($("#select_predefine").val()=='a4') {
    			opt.width = 794;
    			opt.height = 1123;
    		}
    	}
    	else if($('input:radio[name="definition"]:checked').val()=='custom') {
    		//自定义
    		opt.width = parseInt($('#pagewidth').val());
    		opt.height = parseInt($('#pageheight').val());
    	}
    	if($('input:radio[name="cell"]:checked').val()=='cell_num') {
    		//表格行/列数
    		if($("#numcol_checkbox").attr("checked")) {
        		opt.numcol = parseInt($("#numcol_text").val());
        	}
        	if($("#numrow_checkbox").attr("checked")) {
        		opt.numrow = parseInt($("#numrow_text").val());
        	}
    	}
    	else if($('input:radio[name="cell"]:checked').val()=='cell_size') {
    		//单元格宽/高
    		if($("#sizecol_checkbox").attr("checked")) {
        		opt.tdwidth = parseInt($("#sizecol_text").val());
        	}
        	if($("#sizerow_checkbox").attr("checked")) {
        		opt.tdheight = parseInt($("#sizerow_text").val());
        	}
    	}
    	editor.execCommand('mycreatetable',opt);
    };
    </script>
</head>
<body style="padding: 8px">
	<div>
		<p>页面尺寸</p>
		<div>
			<input type="radio" name="definition" value="predefine" checked/>
			预定义：
			<br/>
			<select id="select_predefine" >
 				<option value ="a4">标准A4尺寸[794×1123]px</option>
			</select>
		</div>
		<div>
			<input type="radio" name="definition" value="custom" />
			自定义：
			<br/>
			页宽<input type="text" id="pagewidth" name="pagewidth" title="请填整数" value="794"/>
			<select>
 				<option value ="volvo">像素</option>
			</select>
			<br/>
			页高<input type="text" id="pageheight" name="pageheight" title="请填整数" value="1123"/>
			<select>
 				<option value ="volvo">像素</option>
			</select>
		</div>
	</div>
	<hr/>
	<div>
		<p>表格属性(如果不填,默认单元格68*22px)</p>
		<div>
			<input type="radio" name="cell" value="cell_num" checked/>
			表格行/列数：
			<br/>
			<input type="checkbox" id="numrow_checkbox"/>
			自定义表格行数
			<input type="text" id="numrow_text" title="复选框打钩有效,整数" value="10" style="width:100px"/>
			<br/>
			<input type="checkbox" id="numcol_checkbox"/>
			自定义表格列数
			<input type="text" id="numcol_text" title="复选框打钩有效,整数" value="10" style="width:100px"/>
		</div>
		<div>
			<input type="radio" name="cell" value="cell_size"/>
			单元格宽/高：
			<br/>
			<input type="checkbox" id="sizecol_checkbox"/>
			自定义单元格宽
			<input type="text" id="sizecol_text" title="复选框打钩有效,整数" value="68" style="width:100px"/>
			<select>
 				<option value ="volvo">像素</option>
			</select>
			<br/>
			<input type="checkbox" id="sizerow_checkbox"/>
			自定义单元格高
			<input type="text" id="sizerow_text" title="复选框打钩有效,整数" value="22" style="width:100px"/>
			<select>
 				<option value ="volvo">像素</option>
			</select>
		</div>
	</div>
</body>
</html>